#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
int getdate(string& s) {
  int h, m;
  char c;
  sscanf(s.c_str(), "[%02d:%02d %c", &h, &m, &c);
  if (h == 12) h = 0;
  if (c == 'p') h += 12;
  return h * 60 + m;
}
void solve() {
  cin >> n;
  string s;
  getline(cin, s);
  rep(i, 1, n) {
    getline(cin, s);
    a[i] = getdate(s);
  }
  int ans = 0;
  int l = 1;
  while (l <= n) {
    if (a[l] < a[l - 1]) ans++;
    int h = l + 1;
    while (h <= n && a[l] == a[h]) h++;
    int now = h - l;
    ans += (now - 1) / 10;
    l = h;
  }
  ans++;
  cout << ans << endl;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}